package com.ply.flashsalessystem.entity.status;

import com.ply.flashsalessystem.entity.vo.UserAmountVo;

import java.util.List;
import java.util.Objects;

/**
 * @author XiaoPan
 * date: 2022/3/28 18:53
 * <p>
 * action:
 */
public interface StoreAmountStatus {

//    提现: 1
    Integer TO_CASH = 1;

    Integer InviteUser = 2;
    //提成
    Integer Commission = 3;

    String TO_CASH_String = "提现";

    String InviteUserString = "邀请用户";
    //提成
    String CommissionString = "提成";

    static List<UserAmountVo> intToString(List<UserAmountVo> list) {
        for (UserAmountVo userAmountVo : list) {
            if (Objects.equals(userAmountVo.getStatus(), TO_CASH)){
                userAmountVo.setStatusString(TO_CASH_String);
                continue;
            }
            if (Objects.equals(userAmountVo.getStatus(), InviteUser)){
                userAmountVo.setStatusString(InviteUserString);
                continue;
            }
            if (Objects.equals(userAmountVo.getStatus(), Commission)){
                userAmountVo.setStatusString(CommissionString);
            }

        }
        return list;
    }
}
